using Core;
using UnityEngine;

namespace g_gongjianta
{
    /// <summary>
    /// 弓箭塔
    /// </summary>
    [IsGame]
    public class GameContext : Core.GameContext
    {
        public override void Awake(MonoBehaviour mono, TblGame.Conf conf)
        {
            base.Awake(mono, conf);

            Name = $"g_{conf.Name}";
            // var variant = new VariantData
            // {
            //     IsRand = false,
            //     RandSeed = 0,
            //     Size = 2000,
            // };
            // S.Variant.Push(Name, variant);
        }

        public override void AddCoreComponent()
        {
            base.AddCoreComponent();

            Bind.Bind(this);

            S.Setting.FrameRate.Value = 60;

            Add<VariantSystem>();

            //Core
            Res = Add<ResSystem>();
            UI = Add<UISystem>();
            Table = Add<TableSystem>();
            Audio = Add<AudioSystem>();
            Scene = Add<SceneSystem>();

            Add<FrameSystem, int>(Global.LOGIC_FRAME_RATE);
            Add<UnitSystem>();
            Add<DungeonSystem>();
            Add<ModelSystem>();
            Add<SenseSystem>();
            Add<LifeCycleSystem>();

            // //WeChat
            // Add<AdvertisingSystem>();
            // Add<GameClubSystem>();
        }

        public override void SetVariant(VariantInfo info)
        {
            // Get<VariantSystem>().SetVariant(info.JsonData);
        }
    }
}